<template>
  <div>
    <h1>hello world</h1>
    <el-date-picker
      v-model="value1"
      type="date"
      placeholder="选择日期"
      :size="size"
    />
    <button @click="testJump">测试跳转</button>
  </div>
</template>

<script>
import emitter from "@/utils/event-bus";
export default {
  name: "Index",
  components: {},
  // 定义属性
  data() {
    return {
      size: "default",
      value1: ""
    };
  },
  computed: {},
  watch: {},
  methods: {
    testJump() {
      this.$router.push({
        path: "/demo",
        query: {
          name: "test",
        },
      });
    },
    showText(value) {
      console.log(value);
    },
  },
  created() {
    //注册全局事件
    emitter.on("showtext", (data) => {
      this.showText(data);
    });
  },
  mounted() {},
};
</script>

<style  lang="sccss" scoped>
</style>